<?php

namespace app\api\controller\v1;

use app\api\controller\Base;
use app\common\model\RoleModel;
use think\Request;

class Role extends Base
{
    public function index(Request $request)
    {
        $data = $this->request->post();
        $page = !empty($data['page']) ? $data['page'] : 1;
        $pageSize = !empty($data['pageSize']) ? $data['pageSize'] : 10;
        $db = new RoleModel();
        $where = [];
//        $list = $db->where($where)->page($page,$pageSize)->select();
        $list = $db->where($where)->page($page)->limit($pageSize)->select();

        return json(['code'=>1,'msg'=>'role显示完毕','data'=>$list]);

    }
}